package com.gutai.admin.entity.dto;


import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018\12\24 0024.
 */
public class ImageSizeMap {

    private static Map<String, ImageSize> imageSizeMap;

    public Map<String, ImageSize> getImageSizeMap() {
        return imageSizeMap;
    }

    public void setImageSizeMap(Map<String, ImageSize> imageSizeMap) {
        this.imageSizeMap = imageSizeMap;
    }
    public void put(String key,ImageSize imageSize) {
        if (null == imageSizeMap) {
            imageSizeMap = new HashMap<>();
        }
        imageSizeMap.put(key,imageSize);
    }

    public void put(String key, int width, int height) {
        if (null == imageSizeMap) {
            imageSizeMap = new HashMap<>();
        }
        ImageSize imageSize = new ImageSize();
        imageSize.setWidth(width);
        imageSize.setHeight(height);
        imageSizeMap.put(key, imageSize);
    }
    public ImageSize get(String key) {
        if (null == imageSizeMap) {
            imageSizeMap = new HashMap<>();
        }
        return imageSizeMap.get(key);
    }

}
